extends CharacterBody2D

@export var speed = 400
@export var jump_speed = -400

@onready var animation_player: AnimationPlayer = $AnimationPlayer

var default_gravity: float = ProjectSettings.get("physics/2d/default_gravity")

func _physics_process(delta: float) -> void:
	move(delta)
	
	
func move(delta: float) -> void:
	velocity.x = speed
	if Input.is_action_just_pressed("jump"):
		velocity.y = jump_speed
	if not is_on_floor():
		velocity.y += default_gravity * delta
	move_and_slide()
	
